From: Jim Blandy Date: Fri, 11 Jun 1993 07:02:36 +0000 (+0000) Subject: * xterm.c (x_new_font): If font_names is zero, that's all the X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~95421 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=0c94f6ee88cf57affcdb5e45b603bb39a1b7f7ff;p=emacs.git * xterm.c (x_new_font): If font_names is zero, that's all the indication we get that no matches were found. --- diff --git a/src/xterm.c b/src/xterm.c index 9900ab08884..4d3187d3d0e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3935,6 +3935,11 @@ x_new_font (f, fontname) font_names = (char **) XListFontsWithInfo (x_current_display, fontname, 1024, &n_matching_fonts, &font_info); + /* Apparently it doesn't set n_matching_fonts to zero when it can't + find any matches; font_names == 0 is the only clue. */ + if (! font_names) + n_matching_fonts = 0; + /* Don't just give up if n_matching_fonts is 0. Apparently there's a bug on Suns: XListFontsWithInfo can fail to find a font, but XLoadQueryFont may still find it. */